<?php if($mode == "CAT"){?>
<!-- widget + accordion -->
<div class="widget">
    <div class="widgetTitle">
        <h3>Refine Results</h3>
    </div>
    <!-- /.widgetTitle -->
    <div class="widgetContent">

                 <?php 
				
			if(isset($child)){
					
				$chn=count($child)-1;
				for ($j = 0; $j < count($child); $j++)
				{
					if(count($child[$j])){
						$par = Hierarchy::get_parent('categories',intval($child[$j][0]->id));

						?>
			
                   <div class="accordion">
                       <div class="acc_title">
                       <a class="accordion-toggle" data-toggle="collapse"
						data-parent="#category<?=$j;?>" href="#category<?=$j;?>"> <i
						class="icon-check"></i> <strong><?php if($par->name){?><?= $par->name; ?><?php }else{?>All Category<?php }?></strong> <i
						class="icon-arrow-down pull-right"></i>
					</a>
                       
                           </div>
                           
                           
                           
                       </div><!-- /.acc_content -->
                  		<?php if($chn==$j){?>
				<div id="category<?=$j;?>" class="accordion-body collapse in">
					<?php }else{?>
					<div id="category<?=$j;?>" class="accordion-body collapse">
						<?php }?>
						<div class="acc_content">

							<ul class="list">

								<?php 
								if($child[$j]){
							for ($i=0; $i<count($child[$j]); $i++){?>
								<li>
							<a href="<?= URL::to(Str::slug(Location::get()) . '/' . $child[$j][$i]->slug); ?>"
                               title="<?= $child[$j][$i]->name; ?>"> <?= $child[$j][$i]->name; ?></a>
								</li>
								<?php }
}?>
							</ul>

						</div>
					</div>
				
                   	<?php } 
				}
}?>

    
        <!-- /.acc_content -->
    </div>
    <!-- /.accordion -->
    

</div><!-- /.widgetContent -->


<?php }?>


<?php if($mode == "LOC"){?>

<div class="widget">
    <div class="widgetTitle">
        <h3>Refine Results</h3>
    </div>
    <!-- /.widgetTitle // -->
    <div class="widgetContent">

                   <div class="accordion">
                       <div class="acc_title">
                       <a class="accordion-toggle" data-toggle="collapse"
						data-parent="#category" href="#category"> <i
						class="icon-check"></i> <strong>All Category</strong> <i
						class="icon-arrow-down pull-right"></i>
					</a>
                       
                           </div>
                           
                           
                           
                       </div><!-- /.acc_content -->
                 	<div id="category" class="accordion-body collapse in">
						<div class="acc_content">

							<ul class="list">

								<?php foreach($parent as $parent):?>
								<li>
							<a href="<?= URL::to(Str::slug(Location::get()) . '/' . $parent->slug); ?>"
                               title="<?= $parent->name; ?>"> <?= $parent->name; ?></a>
								</li>
								<?php endforeach;?>

							</ul>

						</div>
					</div>

    
        <!-- /.acc_content -->
    
    <!-- /.accordion -->
    

</div><!-- /.widgetContent -->
</div>
<?php }?>








